<?php
if (isset($data['courses_id']) && !empty($data['courses_id'])) {
    $courseName = getClassCoursCharLimit($data['course_titile']);
    $userDetails = getUserTypeByClassCourse('Courses', $data['courses_id']);
    $imagePath = getImagePathByClassCourse('Courses', $data['courses_id']);
    $url = $this->createAbsoluteUrl('/courses-'.$data['courses_id'].'/'.$data['course_seo_title']);
    $session = Courses::countCousrseBatchDateSession($data['courses_id']);
    $imageName = (ClassImage::getCoursesPrimaryImage($data['courses_id']) != '') ? getRequestbaseUrl() . getuploadFolderDir() . SkillConfig::getClassCourseImagePath($imagePath) . '207X145/' . ClassImage::getCoursesPrimaryImage($data['courses_id']) : getWorkNoshopimage(SkillConfig::skill_home_category_no_image);
    $booknow = ($data['course_type_id'] == COURSE_CLASS_TYPE) ? 'Make Query' : 'Book Now';
    $discount = ClassEarlyDiscount::findMaxDscountByClass($data['courses_id']);
    $priceRange = CourseBatche::findMinMaxPriceByClassbatchforCategoryPage($data['courses_id']);
    $trainerResponse = MakeQuery::trainerResponseRate($data['front-user'], $data['backend-user']);
    $startdate = '';
    $levelType = classCourseLevelType('Courses', $data['courses_id']);
    $cssLevel = LevelCssClassName('Courses', $data['courses_id']);   
    $locationName = ClassVenue::getLocationNameBycourseVenueId($data['course_venue_id']);
    $batchStartDate = date('d  M', strtotime($data['start_date'])) . ' (' . date('D', strtotime($data['start_date'])) . ') ' . '  -  ' . date('d  M', strtotime($data['end_date'])) . ' (' . date('D', strtotime($data['end_date'])) . ')';
}$indexes = $index + 1;
if (($indexes % 3) == 0) {

    echo '<div class="row">';
};
?>

<div class="col-lg-4 col-md-4 col-sm-6">
<a href="<?php echo $url; ?>"> <!-- Link to the Box -->
    <div class="thumbnail">
        <?php echo '<img src="' . $imageName . '"  alt="' . $courseName . '" id="imgClass">'; ?>
        <div class="caption">
            <h4><?php echo $courseName; ?></h4>
            <p class="trainer-name">By:<?php echo substr($userDetails->first_name . '  ' . $userDetails->last_name, 0, 20); ?></p>

            <div class="workinfo">
                <span><?php echo $locationName; ?> <span class="rupee"><?php echo $priceRange; ?></span></span>
                <span><?php echo $batchStartDate; ?></span>
            </div>

            <div class="session">
                <ul class="list-unstyled sessioninfo">
                    <li>
                        <span>session</span>
                        <span><?php echo $session; ?></span>
                    </li>
                    <li>
                        <span class="<?php echo $cssLevel; ?>"></span>
                        <span>Level</span>
                        <span><?php echo $levelType; ?></span>
                    </li>
                    <li>
                        <span>Response Rate</span>
                        <span><?php echo (!empty($trainerResponse) ? $trainerResponse . '%' : TRAINER_RESPONSE_RATE); ?></span>
                    </li>
                </ul>
            </div>

        </div>
    </div>
</a></div>
<?php
if (($indexes % 3) == 0) {
    echo'<div class="gap"></div></div>';
};